/*  
 *  Copyright (C) 2022  JiYu Tech.Co.Ltd All rights reserved.
 *  ==============================================================
 * 
 *  codestyle.c 
 *    代码格式规范与参考，命名规则等。
 *
 *  --------------------------------------------------------------
 *  修改记录：
 *    2022/4/12   @Meng2025     测试通过
 *  
 */

#ifndef __CODESTYLE_H
#define __CODESTYLE_H


#include "system.h"


/* 类型前置声明 */

//数据类型定义
typedef struct _xxx_data
{
  uint8_t data1;
  uint8_t data2;
  uint8_t data3;
} xxx_data_t;


//操作类型定义
typedef struct _xxx_operations xxx_operations_t;

struct _xxx_operations
{
  void (*operations1)(uint8_t d1, uint8_t d2);

  void (*operations2)(uint8_t d1, uint8_t d2);

  void (*operations3)(uint8_t d1, uint8_t d2);

  void (*operations4)(uint8_t d1, uint8_t d2);
};


//器件类型定义，器件一般包含数据操作
typedef struct _xxx_device xxx_device_t;

struct _xxx_device
{
  void (*devece1_init)(void);

  void (*devece2_init)(void);

  const xxx_operations_t *ops;
};


/* 外部变量与全局函数声明 */
extern uint8_t codestyle_a;
extern uint8_t codestyle_b;
extern const xxx_operations_t xxx_ops; //外部操作接口
extern const xxx_device_t xxxxxxx; //外部操作接口

void ops_example(void);


#endif /* __CODESTYLE_H */

